6e404a02c6bdd131721690351c2b47ae52ebeb44,app/src/main/java/com/adam/aslfms/util/Util.java,Util,myNotify,#Context#Class#String#String#number#,441
Before Change
public static void myNotify(Context mCtx, Class chooseActivity, String title, String content, int notID) {
try {
NotificationCompat.Builder builder =
new NotificationCompat.Builder(mCtx)
.setLargeIcon(BitmapFactory.decodeResource(mCtx.getResources(),
R.mipmap.ic_launcher))
.setContentTitle(title)
.setSmallIcon(R.mipmap.ic_notify)
.setContentText(content);
Intent targetIntent = new Intent(mCtx, chooseActivity);
PendingIntent contentIntent = PendingIntent.getActivity(mCtx, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(contentIntent);
NotificationManager nManager = (NotificationManager) mCtx.getSystemService(Context.NOTIFICATION_SERVICE);
nManager.notify(notID, builder.build());
} catch (Exception e) {
After Change
public static void myNotify(Context mCtx, String title, String content, int notID) {
try {
Intent targetIntent = new Intent(mCtx, SettingsActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(mCtx, 0, targetIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder =
new NotificationCompat.Builder(mCtx)
.setContentTitle(title)
.setSmallIcon(R.mipmap.ic_notify)
.setContentText(content)
.setContentIntent(contentIntent);
NotificationManager nManager = (NotificationManager) mCtx.getSystemService(Context.NOTIFICATION_SERVICE);
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR2){
builder.setLargeIcon(BitmapFactory.decodeResource(mCtx.getResources(),
R.mipmap.ic_launcher));
}
nManager.notify(notID, builder.build());
} catch (Exception e) {